# -*- coding: utf-8 -*-
# @Time    : 2021/12/21 10:14
# @Author  : TangDagui
# @Email   : 3297364807@qq.com
# @File    : PythonTaskThree.py
# @Software: PyCharm

import matplotlib.pyplot as plt
file = open(r"成绩.csv", encoding="gbk")
data = []

for i in file:
    i = i.replace("\n", "")
    data.append(i.split(","))

achList = list(data)

ach = []
for i in range(1, len(achList)):
    ach.append(int(achList[i][1]))

plt.hist(ach, 10, range=(50, 100))  # 生成直方图数据
plt.xlabel("成绩", fontproperties="SimHei")  # x轴标签为成绩
plt.ylabel("人数", fontproperties="SimHei")  # y轴标签为人数
plt.show()  # 显示
